home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
utils
/
gredarc
/
vga.h
< prev
Wrap
C/C++ Source or Header
|
1993-03-07
|
8KB
|
428 lines
/***********************************************************
VGA.H
March 1, 1993
R. Dobbins
***********************************************************/
/* Your application begins with this function. The MAIN
function is in the GID library and handles all of the
startup responsibilities. */
void app_start(int argc, unsigned char *argv[]);
/* IMAGPRIM.C defines for the monitor types */
#define MONO 0
#define CGA 1
#define EGAMONO 2
#define EGA 3
#define MCGA 4
#define VGAMONO 5
#define VGA 6
/* the mode this library will operate in */
#define VGA256MODE 0x13
/* IMAGMAIN.C */
typedef struct image_st
{
unsigned char *data;
int row;
int col;
int height;
int width;
unsigned char level;
struct image_st *prev;
struct image_st *next;
} IMAGE_ST;
#define IMAGESZ sizeof(IMAGE_ST)
typedef struct _imagehdr
{
int height;
int width;
int qty;
} IMAGE_HEADER;
#define HDRSZ sizeof(IMAGE_HEADER)
#define HDRSZL (long) sizeof(IMAGE_HEADER)
typedef struct _rply_img
{
unsigned char *image_data;
struct _rply_img *prev;
struct _rply_img *next;
} REPLAY_IMG;
#define REPLAYSZ sizeof(REPLAY_IMG)
#define NUMFONT 4
#ifdef IMAGMAIN
int goterr = 0;
unsigned char *nomerr = "Insufficient Memory";
IMAGE_ST *first_img;
IMAGE_ST *temp_img;
IMAGE_ST *new_img;
IMAGE_ST *curr_img;
double onesec;
IMAGE_HEADER image_header;
unsigned char *vgamask;
unsigned char *vgascrn;
unsigned char bootmode;
unsigned int statusport;
unsigned int allcode;
int screen_loaded = 0;
unsigned char *font_buff[NUMFONT];
int font_height[NUMFONT];
unsigned char *image_data;
int curr_image_record;
#else
extern int goterr;
extern unsigned char *nomerr;
extern unsigned char bootmode;
extern unsigned int statusport;
extern unsigned int allcode;
extern int screen_loaded;
extern unsigned char *font_buff[NUMFONT];
extern int font_height[NUMFONT];
extern IMAGE_ST *first_img;
extern IMAGE_ST *temp_img;
extern IMAGE_ST *new_img;
extern IMAGE_ST *curr_img;
extern double onesec;
extern IMAGE_HEADER image_header;
extern unsigned char *vgamask;
extern unsigned char *vgascrn;
extern unsigned char *image_data;
extern int curr_image_record;
#endif
void getkey(void);
/* IMAGFONT.C */
unsigned char *load_font(unsigned char *ffile,
int *fonthi);
int saystr(int row,
int col,
unsigned char *say,
unsigned char *font,
int fhi,
unsigned char fgd,
unsigned char bkd,
int clrto);
int save_area(int row,
int col,
int height,
int width);
void restore_last(void);
void tellerr(unsigned char *say);
/* IMAGPRIM.C */
int get_adapter(void);
void clrarea( int srow,
int scol,
int height,
int width,
unsigned char scolor);
void setvidmode(unsigned char mmode);
unsigned int calcaddr(int row, int col);
void q_putpix(unsigned int addr, unsigned char mcolor);
void putpix1(int row, int col, unsigned char mcolor);
unsigned char getpix(int row, int col);
void clrall(unsigned char scolor);
void put_hline( int row,
int col,
int llen,
unsigned char scolor);
void put_vline( int row,
int col,
int llen,
unsigned char scolor);
void box( int row,
int col,
int height,
int width,
unsigned char mco);
void clrarea( int srow,
int scol,
int height,
int width,
unsigned char scolor);
void colors_black(void);
void fade_in(void);
void fade_out(void);
/* IMAGSHOW.C */
int alloc_screens(void);
void dealloc_screens(void);
void dealloc_all_images(void);
void initscrn(void);
void initmask(void);
void showscrn(void);
IMAGE_ST *append_image( unsigned char *idata,
int row,
int col,
int height,
int width,
unsigned char level);
unsigned char restfrom( int row,
int col,
unsigned char lvl,
unsigned int addr);
void movefrom( int row,
int col,
unsigned char lvl,
unsigned char newlvl,
unsigned int addr);
void change_level( unsigned char *idata,
int row,
int col,
int height,
int width,
unsigned char lvl,
unsigned char newlvl);
void restimage(unsigned char *idata,
unsigned char lvl,
int row,
int col,
int height,
int width);
void showimage(unsigned char *idata,
unsigned char lvl,
int row,
int col,
int height,
int width);
int load_scrn(unsigned char *fname);
/* IMAGMOVE.C */
#define M_UP 0
#define M_UPRIGHT 1
#define M_RIGHT 2
#define M_DNRIGHT 3
#define M_DOWN 4
#define M_DNLEFT 5
#define M_LEFT 6
#define M_UPLEFT 7
#define M_NOMOVE 8
void moveimageright( unsigned char *image,
int row,
int col,
int height,
int width,
unsigned char lvl);
void moveimageleft(unsigned char *image,
int row,
int col,
int height,
int width,
unsigned char lvl);
void moveimageup(unsigned char *image,
int row,
int col,
int height,
int width,
unsigned char lvl);
void moveimagedown(unsigned char *image,
int row,
int col,
int height,
int width,
unsigned char lvl);
void moveimageupleft(unsigned char *image,
int row,
int col,
int height,
int width,
unsigned char lvl);
void moveimageupright(unsigned char *image,
int row,
int col,
int height,
int width,
unsigned char lvl);
void moveimagedownleft(unsigned char *image,
int row,
int col,
int height,
int width,
unsigned char lvl);
void moveimagedownright(unsigned char *image,
int row,
int col,
int height,
int width,
unsigned char lvl);
void nomoveimage( unsigned char *image,
int row,
int col,
int height,
int width,
unsigned char lvl);
void check_move(IMAGE_ST *icurr, int mdir);
/* IMAGDB.C */
void dealloc_imagedata(void);
int allocate_imagedata(int height, int width);
int read_image_data(int recnum);
int open_imagefile(unsigned char *fname);
int close_imagefile(void);
void dealloc_seq(REPLAY_IMG *dealloc_first);
REPLAY_IMG *load_sequence(unsigned char *fname);
/* IMAGPAL.C */
int load_palette(unsigned char *fname, int setpal);
/* IMAGTIME.C */
void wait_to(long waitcnt);
int getcomputerspeed(void);
/* SETPAL.ASM */
void write_palette(char far *palbuf, int numcolrs, int start_idx);
/* IMAGSPKR.ASM */
void speaker_on(unsigned int note1b,
unsigned int note1a,
unsigned int oldportval);
/* IMAGPLAY.C */
typedef struct
{
unsigned char notenum;
unsigned char regnum;
unsigned char duration;
} NOTE_ST;
void start_music(NOTE_ST *usermusic, unsigned int maxn);
void suspend_music(void);
void continue_music(void);
void quit_music(void);
/* IMAGPAN.ASM */
void pan_screen(int horiz, int vert);